program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  n, k, i, j, f, b, c, e, g : integer;
  mass : array [0..1000] of array [0..1000] of integer;
begin
  read (n, k);
  readln;

  for i := 0 to n-1 do
  begin
    for j:= 0 to k-1 do
    begin
      mass[i][j]:=0;
      if (1=1) then
      begin
        b:=1;
        c:=1;
        g:=1;
        if (i>=j) then
        begin
          if (j>0) then
          begin
            for f:= 0 to i-1 do
              b:=b*(f+1);
            for f := 0 to j-1 do
              c:=c*(f+1);
            for f:= 0 to i-j-1 do
              g:=g*(f+1);
            if (b=c) then
              mass[i][j]:=1;
            if (b<>c) then
            begin
              e:=(b div (c*g));
              mass[i][j]:=e;
            end;
          end;
          if (j=0) then
            mass[i][0]:=1;
          write (mass[i][j], ' ');
        end;
      end;
    end;
    writeln;
  end;
  readln;
end.
